
<?php



	//Pagging	
	$batas_data				=	20;
	$page					=	$_GET["page"];
	if(empty($page)) {
		$posisi				=	0;
		$page				=	1;
	} else {
		$posisi				=	($page - 1) * $batas_data;
	}
//Select Data
	$query=dbQuery("select * from tbpembayaran a,tbdetail_bayar b,tbcustomer c where a.id_order=b.id_order and a.id_customer=c.id_customer order by a.id_order limit $posisi,$batas_data")or die(mysql_error());
	
	
	
	echo"<tr><td colspan='3'>&nbsp;</td></tr>";
	echo"<tr><td colspan='3' class='judul'>&#187 Management Transaksi</td></tr>";
	echo"<tr><td colspan='3' class='jarak_garis'><hr color='#6d6a69'>&nbsp;</hr></td></tr>";

	?>
	
	<table width="100%" border="0" cellpadding="3" cellspacing="1" align="center" class="tabel">
		<tr> 
    		
  		</tr>
		<form name="search_order" id="search_order" action="index_admin.php?index=search_order&cryption=<?php print $encode."*upn*".$santra.$random; ?>
          "method="post" enctype="multipart/form-data">
		
		<tr bgcolor="#1085ac">
    	<td  colspan="5" height="20" ><span class="title_atas">Report Transaksi</span> 
		<input type="text" name="tanggal_satu" id="tanggal_satu" class="form"  readonly="readonly">&nbsp;<a href="javascript:showCalendar('coba_satu')"><img src="../picture/calender.gif" width="30" height="19" align="absmiddle" border="0" /></a>
			
			 <font color="white">|</font> 
			<input type="text" name="tanggal_dua" id="tanggal_dua" class="form"  readonly="readonly">&nbsp;<a href="javascript:showCalendar('coba_dua')"><img src="../picture/calender.gif" width="30" height="19" align="absmiddle" border="0" /></a>&nbsp;<input type="image" src="../picture/search.png" width="20" height="20" border="0" align="absmiddle"></td>
			
			
			
		  	</tr>
			</form>
	<tr class="title_atas" bgcolor="#0ab3eb" align="center">
		<td width="10%" align="center">No Nota</td>
		<td width="20%">Nama Customer</td>
		<td width="10%">Tanggal</td>
		
		<td width="15%">Total Bayar</td>
		
		<td width="2%"  >Action</td>
		
	</tr>
	<?php
	
		$urutan = 1;
	while($data=dbAssoc($query)){
		if($urutan% 2 == 0) {
				$bgcolor	=	"#5ad1f4";
			} else {
				$bgcolor	=	"#FFFFFF";
	}
	$harga=$data['total_bayar'];
	$harga_tampil=Uang($harga);
	
	?>
	
	<tr class="list_admin" align="center" bgcolor="<?php print $bgcolor; ?>">
	<td width="5%" align="center" ><?php print $data['id_order']; ?></td>
		<td width="20%" align="center" ><?php print $data['nama_lengkap']; ?></td>
		<td width="20%" align="center"><?php print $data['tanggal']; ?></td>
		<td width="10%" align="center">Rp.<?php print $harga_tampil;?></td>
		
		
		
				
	
    		
			
			<td><a href="<?php echo "index_admin.php?index=detail_order&id_order=$data[id_order]&cryption=$encode.*upn*.$santra.$random"; ?>"> <img src="../picture/detail.png" width="15" height="15" border="0" /></a></td>
		
	</tr>
	
	
	<?php $urutan ++;
}
	
	?>
	
	
	
	
	
	<?php
	
	
	echo "<tr><td colspan='9'>&nbsp;</td></tr>";
	echo "<tr><td colspan='9'><div align='center' id='pagging'>";
	$sql	=	"select * from tbpembayaran a,tbdetail_bayar b,tbcustomer c where a.id_order=b.id_order and a.id_customer=c.id_customer order by a.id_order   ";
	$query3	=	dbQuery($sql);

	$baris	=	dbRows($query3);
	$jumlahhalaman			=	ceil($baris/$batas_data);
	$file_place				=	"index_pegawai.php?index=manage_transaksi&cryption=$encode.*phb*.$phb.$random";
	if ($page > 1) {
		$previous			=	$page - 1;
		echo "<a href='$file_place&page=1'><< First</a> | <a href='$file_place&page=$previous'>< Previous</a> | ";
	} else {
		echo "<< First | < Previous | ";
	}
	for($ifa=1; $ifa<=$jumlahhalaman; $ifa++) {
		if($ifa != $page) {
			echo " <a href='$file_place&page=$ifa'>$ifa</a> | ";
		} else {
			echo " <strong>$ifa</strong> | ";
		}
	}
	if($page < $jumlahhalaman) {
		$next				=	$page + 1;
		echo "<a href='$file_place&page=$next'>Next ></a> | <a href='$file_place&page=$jumlahhalaman'>Last >></a>";
	} else {
		echo "Next > | Last >>";
	}
	echo"<tr><td colspan='2'>&nbsp</tr>";
	echo"</table></td></tr>";
	
	
	

		
?>